
import service from '/@/utils/request';
import { defineStore } from 'pinia';

export const useDevicemanager = defineStore('deviceManagerStor', {
	state: () => ({
		deviceManagers: [] as any[],
	}),
	actions: {
		addDeviceManager(deviceManager: { companyId: string; wxid: string; wxname: string; wxavatar: string }) {
			return service.post('/api/devicemanager', deviceManager);
		},
		getDeviceManagerList(companyId: string) {
			return service.get(`/api/devicemanager?companyId=${companyId}`);
		},
		removeDeviceManager(id: String) {
			return service.delete(`/api/devicemanager/${id}`);
		},
	},
});
